import java.util.Scanner;

public class Main3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        String s = Integer.toString(n);
        int left = 0;
        int right = s.length() - 1;
        while (left < right) {
            char a = s.charAt(left);
            char b = s.charAt(right);
            if (a != b) {
                break;
            }
            left++;
            right--;
        }
        System.out.println(s.length());
        if (left >= right) {
            System.out.println("Y");
        } else {
            System.out.println("N");
        }
    }
}
